#include <stdio.h>
#include <stdlib.h>

struct date
{
    unsigned char day;
    unsigned char month;
    unsigned short year;
};


void date_read(struct date *pdate)
{
    int day, month, year;
    scanf("%d %d %d", &day, &month, &year);
    pdate->day = day;
    pdate->month = month;
    pdate->year = year;
}

void date_validate(struct date *pdate)
{
    unsigned char day_list[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    if(pdate->year%100)
    {
        if(!(pdate->year%400))day_list[1]++;
    }
    else
    {
        if(!(pdate->year%4))day_list[1]++;
    }
    if(pdate->month > 12)pdate->month = 12;
    if(pdate->day > day_list[pdate->month - 1])pdate->day = day_list[pdate->month - 1];
}

void date_show(struct date *pdate)
{
    switch (pdate->month)
    {
    case 1:
        printf("January");
        break;
    case 2:
        printf("February");
        break;
    case 3:
        printf("March");
        break;
    case 4:
        printf("April");
        break;
    case 5:
        printf("May");
        break;
    case 6:
        printf("June");
        break;
    case 7:
        printf("July");
        break;
    case 8:
        printf("August");
        break;
    case 9:
        printf("September");
        break;
    case 10:
        printf("October");
        break;
    case 11:
        printf("November");
        break;
    default:
        printf("December");
        break;
    }
    printf(" %d,%d\n", pdate->day, pdate->year);
}

int main()
{
    struct date date_data;
    date_read(&date_data);
    date_validate(&date_data);
    date_show(&date_data);
    return 0;
}